package com.yurpceasy.registry;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

public class LocalRegistry {

    private static Map<String,Class<?>> registry = new ConcurrentHashMap<>();

    /**
     * 注册服务
     * @param serviceName
     * @param implClass
     */
    public static void register(String serviceName,Class<?> implClass)
    {
        registry.put(serviceName, implClass);
    }

    /**
     * 获取服务
     * @param serviceName
     * @return
     */

    public static Class<?> get(String serviceName) {
        return registry.get(serviceName);
    }

    public static void remove(String serviceName) {
        registry.remove(serviceName);
    }

}
